var pwdReg = /^(\w){6,20}$/;
function checkIn() {
	var pwd1 = document.getElementById("pwd").value;
	var pwd2 = document.getElementById("pwd1").value;
	var phone = localStorage.pwdPhone;
	if (!pwd1) {
		mui.toast('请输入密码');
		return;
	}
	if (!pwd2) {
		mui.toast('请输入确认密码');
		return;
	}
	if (pwd1 != pwd2) {
		mui.toast('两次输入的密码不一致，请重新输入');
		document.getElementById("pwd").value = '';
		document.getElementById("pwd1").value = '';
		return;
	}
	if (!pwdReg.exec(pwd1)) {
		mui.toast('密码不符合要求,请重新输入');
		document.getElementById("pwd").value = '';
		document.getElementById("pwd1").value = '';
		return;
	}
	var dataString = "account=" + phone + "&password=" + pwd1 + "&password2=" + pwd2;
	var urls = getUrl("findPwd");
	plus.nativeUI.showWaiting();
	mui.ajax(urls, {
		data: dataString,
		dataType: 'json',
		type: 'post',
		timeout: 3000,
		success: function(data) {
			plus.nativeUI.closeWaiting();
			if (data) {
				if (data.code == '0') {
					delete localStorage.pwdPhone;
					OpenNewWin({
						id : 'loginHead.html' ,
						url: 'loginHead.html'
					})
					plus.webview.getWebviewById('searchPwdHead.html').close();
					plus.webview.getWebviewById('findPwdHead.html').close();
				} else {
					mui.toast(data.msg)
				}
			} else {
				mui.toast('网络异常，提交失败，请重试');
			}
		},
		error: function(xhr, type, errorThrown){
			//异常处理；
			plus.nativeUI.closeWaiting();
			mui.toast('网络异常，提交失败，请重试');
		}
	});
}